import java.util.Arrays;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        sc.nextLine();
        String[] s = sc.nextLine().trim().split(" ");
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = Integer.parseInt(s[i]);
        }
        System.out.println(function(n, x, y, nums));
    }
    public static int function(int n, int x, int y, int[] arr) {
        Arrays.sort(arr);
        int m = arr[0];
        for (int i = 1; i < n; i++) {


            if (arr[i] > m) {
                int num = n - i;
                if (x <= num && y >= num  && n - num >= x && n - num <= y){
                    return m;
                }
            }
            m = arr[i];
        }
        return -1;



    }
}
